/**
 * 
 */
package name.shamansir.tadah.data.scheduling;

import android.text.format.Time;

/**
 * <dl>
 * <dt>Project:</dt> <dd>ta-dah</dd>
 * <dt>Package:</dt> <dd>name.shamansir.tadah.data.scheduling</dd>
 * </dl>
 *
 * <code>HasDuration</code>
 *
 * <p>Description</p>
 *
 * @author Ulric Wilfred <shaman.sir@gmail.com>
 * @date Feb 22, 2011 8:26:22 PM 
 *
 */
public interface HasDuration {
    
    /**
     * Tests target if it fits passed period (when both parameters are set)
     * or passed date (when <code>start</code> is set and <code>end</code> is <code>null</code>).
     * Returns the period matched (can be less than or equal to given period,
     * but can't be greater than). In case if <code>start</code> happens
     * later then <code>end</code>, they will be swapped.
     * 
     * @param start start date-time or just date to match
     * @param end end date-time to match; if <code>null</code>, <code>start</code>
     *            parameter is treated as    
     * @return matched period or <code>null</code>, if not matched
     */
    public Run match(Time start, Time end);

}
